/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.dengues.model.component.impl;

import org.dengues.model.component.COMPONENTType;
import org.dengues.model.component.CONNECTIONSType;
import org.dengues.model.component.ComponentPackage;
import org.dengues.model.component.HEADERType;
import org.dengues.model.component.IMPORTSType;
import org.dengues.model.component.PARAMETERSType;
import org.dengues.model.component.RETURNSType;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>COMPONENT Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.dengues.model.component.impl.COMPONENTTypeImpl#getHEADER <em>HEADER</em>}</li>
 *   <li>{@link org.dengues.model.component.impl.COMPONENTTypeImpl#getPARAMETERS <em>PARAMETERS</em>}</li>
 *   <li>{@link org.dengues.model.component.impl.COMPONENTTypeImpl#getRETURNS <em>RETURNS</em>}</li>
 *   <li>{@link org.dengues.model.component.impl.COMPONENTTypeImpl#getCONNECTIONS <em>CONNECTIONS</em>}</li>
 *   <li>{@link org.dengues.model.component.impl.COMPONENTTypeImpl#getIMPORTS <em>IMPORTS</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class COMPONENTTypeImpl extends EObjectImpl implements COMPONENTType {
    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public static final String copyright = "// ============================================================================\r\n//\r\n// Copyright (C) 2006-2007 Dengues\r\n//\r\n// Google Group: http://groups.google.com/group/dengues\r\n// QQ Group: 24885404\r\n//\r\n// This library is free software; you can redistribute it and/or\r\n// modify it under the terms of the GNU Lesser General Public\r\n// License as published by the Free Software Foundation; either\r\n// version 2.1 of the License.\r\n//\r\n// This library is distributed in the hope that it will be useful,\r\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r\n// Lesser General Public License for more details.\r\n//\r\n// You should have received a copy of the GNU General Public License\r\n// along with this program; if not, write to the Free Software\r\n// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r\n//\r\n// ============================================================================\r\n";

    /**
     * The cached value of the '{@link #getHEADER() <em>HEADER</em>}' containment reference.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getHEADER()
     * @generated
     * @ordered
     */
    protected HEADERType hEADER;

    /**
     * The cached value of the '{@link #getPARAMETERS() <em>PARAMETERS</em>}' containment reference.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getPARAMETERS()
     * @generated
     * @ordered
     */
    protected PARAMETERSType pARAMETERS;

    /**
     * The cached value of the '{@link #getRETURNS() <em>RETURNS</em>}' containment reference.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getRETURNS()
     * @generated
     * @ordered
     */
    protected RETURNSType rETURNS;

    /**
     * The cached value of the '{@link #getCONNECTIONS() <em>CONNECTIONS</em>}' containment reference.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getCONNECTIONS()
     * @generated
     * @ordered
     */
    protected CONNECTIONSType cONNECTIONS;

    /**
     * The cached value of the '{@link #getIMPORTS() <em>IMPORTS</em>}' containment reference.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getIMPORTS()
     * @generated
     * @ordered
     */
    protected IMPORTSType iMPORTS;

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    protected COMPONENTTypeImpl() {
        super();
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected EClass eStaticClass() {
        return ComponentPackage.Literals.COMPONENT_TYPE;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public HEADERType getHEADER() {
        return hEADER;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetHEADER(HEADERType newHEADER, NotificationChain msgs) {
        HEADERType oldHEADER = hEADER;
        hEADER = newHEADER;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ComponentPackage.COMPONENT_TYPE__HEADER, oldHEADER, newHEADER);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
        return msgs;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setHEADER(HEADERType newHEADER) {
        if (newHEADER != hEADER) {
            NotificationChain msgs = null;
            if (hEADER != null)
                msgs = ((InternalEObject)hEADER).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ComponentPackage.COMPONENT_TYPE__HEADER, null, msgs);
            if (newHEADER != null)
                msgs = ((InternalEObject)newHEADER).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ComponentPackage.COMPONENT_TYPE__HEADER, null, msgs);
            msgs = basicSetHEADER(newHEADER, msgs);
            if (msgs != null) msgs.dispatch();
        }
        else if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.COMPONENT_TYPE__HEADER, newHEADER, newHEADER));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public PARAMETERSType getPARAMETERS() {
        return pARAMETERS;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetPARAMETERS(PARAMETERSType newPARAMETERS, NotificationChain msgs) {
        PARAMETERSType oldPARAMETERS = pARAMETERS;
        pARAMETERS = newPARAMETERS;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ComponentPackage.COMPONENT_TYPE__PARAMETERS, oldPARAMETERS, newPARAMETERS);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
        return msgs;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setPARAMETERS(PARAMETERSType newPARAMETERS) {
        if (newPARAMETERS != pARAMETERS) {
            NotificationChain msgs = null;
            if (pARAMETERS != null)
                msgs = ((InternalEObject)pARAMETERS).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ComponentPackage.COMPONENT_TYPE__PARAMETERS, null, msgs);
            if (newPARAMETERS != null)
                msgs = ((InternalEObject)newPARAMETERS).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ComponentPackage.COMPONENT_TYPE__PARAMETERS, null, msgs);
            msgs = basicSetPARAMETERS(newPARAMETERS, msgs);
            if (msgs != null) msgs.dispatch();
        }
        else if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.COMPONENT_TYPE__PARAMETERS, newPARAMETERS, newPARAMETERS));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public RETURNSType getRETURNS() {
        return rETURNS;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetRETURNS(RETURNSType newRETURNS, NotificationChain msgs) {
        RETURNSType oldRETURNS = rETURNS;
        rETURNS = newRETURNS;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ComponentPackage.COMPONENT_TYPE__RETURNS, oldRETURNS, newRETURNS);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
        return msgs;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setRETURNS(RETURNSType newRETURNS) {
        if (newRETURNS != rETURNS) {
            NotificationChain msgs = null;
            if (rETURNS != null)
                msgs = ((InternalEObject)rETURNS).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ComponentPackage.COMPONENT_TYPE__RETURNS, null, msgs);
            if (newRETURNS != null)
                msgs = ((InternalEObject)newRETURNS).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ComponentPackage.COMPONENT_TYPE__RETURNS, null, msgs);
            msgs = basicSetRETURNS(newRETURNS, msgs);
            if (msgs != null) msgs.dispatch();
        }
        else if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.COMPONENT_TYPE__RETURNS, newRETURNS, newRETURNS));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public CONNECTIONSType getCONNECTIONS() {
        return cONNECTIONS;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetCONNECTIONS(CONNECTIONSType newCONNECTIONS, NotificationChain msgs) {
        CONNECTIONSType oldCONNECTIONS = cONNECTIONS;
        cONNECTIONS = newCONNECTIONS;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ComponentPackage.COMPONENT_TYPE__CONNECTIONS, oldCONNECTIONS, newCONNECTIONS);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
        return msgs;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setCONNECTIONS(CONNECTIONSType newCONNECTIONS) {
        if (newCONNECTIONS != cONNECTIONS) {
            NotificationChain msgs = null;
            if (cONNECTIONS != null)
                msgs = ((InternalEObject)cONNECTIONS).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ComponentPackage.COMPONENT_TYPE__CONNECTIONS, null, msgs);
            if (newCONNECTIONS != null)
                msgs = ((InternalEObject)newCONNECTIONS).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ComponentPackage.COMPONENT_TYPE__CONNECTIONS, null, msgs);
            msgs = basicSetCONNECTIONS(newCONNECTIONS, msgs);
            if (msgs != null) msgs.dispatch();
        }
        else if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.COMPONENT_TYPE__CONNECTIONS, newCONNECTIONS, newCONNECTIONS));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public IMPORTSType getIMPORTS() {
        return iMPORTS;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetIMPORTS(IMPORTSType newIMPORTS, NotificationChain msgs) {
        IMPORTSType oldIMPORTS = iMPORTS;
        iMPORTS = newIMPORTS;
        if (eNotificationRequired()) {
            ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ComponentPackage.COMPONENT_TYPE__IMPORTS, oldIMPORTS, newIMPORTS);
            if (msgs == null) msgs = notification; else msgs.add(notification);
        }
        return msgs;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setIMPORTS(IMPORTSType newIMPORTS) {
        if (newIMPORTS != iMPORTS) {
            NotificationChain msgs = null;
            if (iMPORTS != null)
                msgs = ((InternalEObject)iMPORTS).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ComponentPackage.COMPONENT_TYPE__IMPORTS, null, msgs);
            if (newIMPORTS != null)
                msgs = ((InternalEObject)newIMPORTS).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ComponentPackage.COMPONENT_TYPE__IMPORTS, null, msgs);
            msgs = basicSetIMPORTS(newIMPORTS, msgs);
            if (msgs != null) msgs.dispatch();
        }
        else if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.COMPONENT_TYPE__IMPORTS, newIMPORTS, newIMPORTS));
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case ComponentPackage.COMPONENT_TYPE__HEADER:
                return basicSetHEADER(null, msgs);
            case ComponentPackage.COMPONENT_TYPE__PARAMETERS:
                return basicSetPARAMETERS(null, msgs);
            case ComponentPackage.COMPONENT_TYPE__RETURNS:
                return basicSetRETURNS(null, msgs);
            case ComponentPackage.COMPONENT_TYPE__CONNECTIONS:
                return basicSetCONNECTIONS(null, msgs);
            case ComponentPackage.COMPONENT_TYPE__IMPORTS:
                return basicSetIMPORTS(null, msgs);
        }
        return super.eInverseRemove(otherEnd, featureID, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case ComponentPackage.COMPONENT_TYPE__HEADER:
                return getHEADER();
            case ComponentPackage.COMPONENT_TYPE__PARAMETERS:
                return getPARAMETERS();
            case ComponentPackage.COMPONENT_TYPE__RETURNS:
                return getRETURNS();
            case ComponentPackage.COMPONENT_TYPE__CONNECTIONS:
                return getCONNECTIONS();
            case ComponentPackage.COMPONENT_TYPE__IMPORTS:
                return getIMPORTS();
        }
        return super.eGet(featureID, resolve, coreType);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case ComponentPackage.COMPONENT_TYPE__HEADER:
                setHEADER((HEADERType)newValue);
                return;
            case ComponentPackage.COMPONENT_TYPE__PARAMETERS:
                setPARAMETERS((PARAMETERSType)newValue);
                return;
            case ComponentPackage.COMPONENT_TYPE__RETURNS:
                setRETURNS((RETURNSType)newValue);
                return;
            case ComponentPackage.COMPONENT_TYPE__CONNECTIONS:
                setCONNECTIONS((CONNECTIONSType)newValue);
                return;
            case ComponentPackage.COMPONENT_TYPE__IMPORTS:
                setIMPORTS((IMPORTSType)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eUnset(int featureID) {
        switch (featureID) {
            case ComponentPackage.COMPONENT_TYPE__HEADER:
                setHEADER((HEADERType)null);
                return;
            case ComponentPackage.COMPONENT_TYPE__PARAMETERS:
                setPARAMETERS((PARAMETERSType)null);
                return;
            case ComponentPackage.COMPONENT_TYPE__RETURNS:
                setRETURNS((RETURNSType)null);
                return;
            case ComponentPackage.COMPONENT_TYPE__CONNECTIONS:
                setCONNECTIONS((CONNECTIONSType)null);
                return;
            case ComponentPackage.COMPONENT_TYPE__IMPORTS:
                setIMPORTS((IMPORTSType)null);
                return;
        }
        super.eUnset(featureID);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public boolean eIsSet(int featureID) {
        switch (featureID) {
            case ComponentPackage.COMPONENT_TYPE__HEADER:
                return hEADER != null;
            case ComponentPackage.COMPONENT_TYPE__PARAMETERS:
                return pARAMETERS != null;
            case ComponentPackage.COMPONENT_TYPE__RETURNS:
                return rETURNS != null;
            case ComponentPackage.COMPONENT_TYPE__CONNECTIONS:
                return cONNECTIONS != null;
            case ComponentPackage.COMPONENT_TYPE__IMPORTS:
                return iMPORTS != null;
        }
        return super.eIsSet(featureID);
    }

} //COMPONENTTypeImpl
